home *** CD-ROM | disk | FTP | other *** search
Text File | 1989-12-08 | 2.5 KB | 63 lines | [TEXT/GEOL] |
- Item 5182108 4-Dec-89 14:38
-
- From: D1282 Power Up,PRT
-
- To: MACAPP.TECH$ MacApp Technical
- KEMINK1 Kemink, Joost
-
- Sub: DoInitViews again
-
- Attn: MacApp.Tech$
- Attn: Kemink, Joost
- SentBy: James Plamondon
- Date 12/4/89
- Subject DoInitViews again
- From James Plamondon
- To Kemink, Joost
- CC MacApp.Tech$
-
- Reply to: DoInitViews again
- Dear Mr. Kemink,
-
- I read your link this morning, on DoInitViews(), with both pleasure and dread.
- Pleasure, because it contained lots of good ideas, and dread, because (you're
- right!) it made DoInitViews() look a lot tougher to write than I had hoped.
-
- I had indeed intended to use IRes() to do most of the work for me, and now I
- see that I can't. People do mix up their object creation with their object
- initialization; MacApp does not recognize a distinction between these two.
- IClassName() and IRes(), in which the "I" stands for "initialize," perform
- both object creation and initialization. That is, if I hav a class TFoo that
- has contains an object (fBar) of class TBar, then both IFoo() and TFoo.IRes()
- create fBar and then initialize it. Therein lies the fatal flaw.
-
- To add view re-initialization to MacApp, I would have to add a basic new
- method to TView: the method TView.ReInitRes(). This method would assume that
- whatever allocations TView.IRes() performs have been done, and would
- re-initialize the view to match its resource. This method could be called by
- IRes(), after IRes() had done its allocating. It would certainly be called by
- the proposed routines DoInitViews() and InitAView(). Adding this method to
- all of the various view classes in MacApp (31 by my count in 2.0B9) would not
- be a trivial task. However, one of the standard rules-of-thumb in OOP is to
- break up class functionality into separate methods wherever it is both
- possible and meaningful, so that one can override the fewest possible methods
- to change a class' behaviour. I think that this distinction, between creation
- and initialization (which allows re-initialization) is both meaningfull and
- possible.
-
- What do you think? Seem like more trouble that it's worth?
-
- Looking forward to your response (and to that of any other interested party —
- like maybe the MacApp Programming Team), I remain
-
- Yours,
-
- James Plamondon
- Software Engineer
- PowerUp! Software
- 2929 Campus Drive, Suite 300
- San Mateo, CA 94403
- (415) 345-5900 x351
- AppleLink: PowerUp.Eng
-
-